The present invention relates to a motion compensation image encoding device which performs motion compensation and encodes and transmits a motion vector and its prediction error.
For the purpose of application, for example, to mobile video communications by the PCS and portable telephone systems and monitor image transmissions over telephone circuits as well as to a dynamic image transmission on the Internet, there is a demand for a high-quality image compression technique that achieves an ultra-low bit rate below 20 kbps as a video rate.
In this field, too, the most popular image compression technique is one that utilizes a motion compensation DCT (Discrete Cosine Transform) system as typified by ITU-T Recommendation H. 263. Conventional motion compensation systems perform motion detection from a viewpoint of minimizing a prediction error, and transmit a motion vector and the prediction errors in coded form.
In conventional ultra-low bit rate image coding scheme typified by Recommendation H. 263, the motion detection takes place through block matching which is carried out for each macro block. For example, TMN5 takes into account the precedence of zero vector but basically involves vector detection intended to minimize the prediction error.
FIG. 10 is a block diagram depicting an example of a conventional motion compensation image encoding device, in which image signals input via an input terminal 1 are sequentially stored in a current frame memory 2 and a previous frame (reference frame) memory 3. A motion vector from a motion vector generator 4 is provided to a motion compensation circuit 5, wherein it is used for motion compensation of a previous frame signal from the previous frame (reference frame) memory 3, then a difference between a current frame signal from the current frame memory 2 and its motion-compensated output is detected by a subtractor 6, and the difference is fed to an encoder 26 and a motion prediction error detector 21. A minimum prediction error decision circuit 22 decides a minimum prediction error based on the motion vector fed from the motion vector generator 4 and the motion prediction error from the motion prediction error detector 21. This minimum prediction error is delayed, for example, by a one-block delay circuit 23 and is stored, as a next left block, in a motion vector memory 24, and a difference motion vector, which corresponds to a difference between the minimum prediction error and an output from the motion vector memory 24, is obtained by a substracter 25 and provided to an encoder 27.
That is, letting xt (i, j) and xtxe2x88x921 (i, j) represent pixel values of current and previous frames, respectively, a value SAD (Sum of Absolute Differences) is given by the following equation (1).                     SAD        =                              ∑            j                    ⁢                                    ∑              i                        ⁢                          "LeftBracketingBar"                                                                    x                    t                                    ⁡                                      (                                          i                      ,                      j                                        )                                                  -                                                      x                                          t                      -                      1                                                        ⁡                                      (                                          i                      +                                              mv                                                  x                          ,                          j                                                                    +                                              mv                        y                                                              )                                                              "RightBracketingBar"                                                          (        1        )            
The motion vectors mvx and mvy which minimize the value SAD are detected for each macro block.
At medium to high bit rates above 100 kbps, the amount of information about the motion vector is substantially negligible as compared with the amount of information on the prediction difference signal; hence, the minimization of the value SAD is a key factor in the quantization of the prediction error signal with the highest precision.
In the motion detection at ultra-low bit rates, however, the proportion of the amount of motion vectors to a current bit rate increases. Table 1 shows respective occupation of bit rates and the proportions of the motion vectors in an image xe2x80x9cCarphone.xe2x80x9d
The frame rate is fixed at 5 fps, and the number of motion vector bits is a mean value for each processed frame. From this table, it is understandable that the number of geberated bits from the motion vector is substantially constant irrespective of the bit rate. Accordingly, as the bit rate decreases, the proportion of the motion vector increases; the latter exceeds 20% at ultra-low bit rates below 20 kbps.
As described above, the conventional motion compensation image encoding device performs the motion detection by block matching so that the power (square sum) of the prediction error block or its value SAD is minimized.
In the conventional device, the current frame is divided into blocks, and for each block, a position where the square sum or the value SAD of an error (a prediction error) relative to an immediately previous frame (a reference frame) stored in the frame memory is minimized is detected in the range of search, and the position detected is used as a motion vector.
In the actual motion vector transmission, a difference between the motion vector of each block and that of the left or upper block is sent since the motion vector has a strong correlation to the neighboring blocks.
The prior art makes the motion detection solely for the purpose of minimizing the prediction error as mentioned above, and hence it does not ever take into consideration the amount of information on the motion vector. On this account, no sufficient amount of information is assigned to the motion prediction error, so that the quantization step size for the motion prediction error increases, inevitably incurring the degradation of the image quality.
An object of the present invention is to provide a motion compensation image encoding device which obviates the problems of the prior art and, for enhancement of the image quality at ultra-low bit rates, permits quantization of the prediction error with the highest possible degree of accuracy, taking into account the amount of information generated from the motion vector.
To attain the above object, the motion compensation image encoding device according to the present invention comprises:
first encoding means for encoding motion prediction error information corresponding to a difference between an image signal of a current frame and a compensated output of an image signal of a reference frame preceding the current frame, obtained by motion-compensation by the use of a motion vector generated by a motion vector generator; and
second encoding means for obtaining a difference vector corresponding to a difference between said motion vector and a motion vector of an already encoded reference pixel block located near the current pixel block to be encoded in said current frame, and for encoding an output resulting from motion detection of said difference vector so as to obtain the minimum step size from said difference vector, through the use of the number of bits generated, which is estimated from the magnitude of a motion prediction error contained in said motion prediction error information, and the number of generated bits of said difference vector.